package co.sumset.vista;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class VentanaInformacion extends JFrame
implements ActionListener {

	VentanaPrincipal ventanaPrincipal = null;
	private JButton btnJugar = null;
	private JLabel etiquetaInstrucciones = null;
	private JLabel jLabel2 = null;
	private JLabel jLabel3 = null;
	private JLabel jLabel4 = null;
	private JLabel jLabel5 = null;
	private JLabel jLabel8 = null;
	private JLabel jLabel7 = null;
	private JButton btnSalir = null;
	private JLabel jLabel6 = null;
	private JComboBox comboNivel = null;
	private JSeparator SeparadorArri = null;
	private JSeparator SeparatorAba = null;
	private JSeparator SeparatorDer = null;
	private JSeparator SeparatorIzq = null;
	private JLabel jLabel1 = null;
	Administrador admin = null;

	public VentanaInformacion(VentanaPrincipal ventanaPrincipal) {
		this.ventanaPrincipal = ventanaPrincipal;
		initGUI();
	}

	private void initGUI() {
		try {
			setDefaultCloseOperation(3);
			getContentPane().setLayout(((java.awt.LayoutManager) (null)));
			setIconImage((new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/juego/inv02.png"))).getImage());
			btnJugar = new JButton();
			FlowLayout ntnJugarLayout = new FlowLayout();
			getContentPane().add(((java.awt.Component) (btnJugar)));
			btnJugar.setLayout(((java.awt.LayoutManager) (null)));
			btnJugar.setBounds(404, 108, 109, 109);
			btnJugar.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/botones/btnJugar.png")))));
			btnJugar.setBackground(new Color(255, 255, 255));
			btnJugar.addActionListener(((ActionListener) (this)));
			etiquetaInstrucciones = new JLabel();
			getContentPane().add(((java.awt.Component) (etiquetaInstrucciones)));
			etiquetaInstrucciones.setText("Instrucciones");
			etiquetaInstrucciones.setBounds(1, -1, 193, 44);
			etiquetaInstrucciones.setFont(new Font("Arial Rounded MT Bold", 1, 18));
			jLabel1 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel1)));
			jLabel1.setText("<html>Atacar:<html>");
			jLabel1.setFont(new Font("Arial Rounded MT Bold", 1, 14));
			jLabel1.setBounds(10, 75, 230, 25);
			jLabel2 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel2)));
			jLabel2.setText("<html>   -Disparo: Barra espaciadora.<html>");
			jLabel2.setFont(new Font("Arial Rounded MT Bold", 1, 14));
			jLabel2.setBounds(46, 100, 267, 30);
			jLabel2.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/balaDer.png")))));
			jLabel3 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel3)));
			jLabel3.setText("<html>-Bomba: tecla B.<html>");
			jLabel3.setFont(new Font("Arial Rounded MT Bold", 1, 14));
			jLabel3.setBounds(46, 133, 230, 25);
			jLabel3.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/bombUL.gif")))));
			jLabel4 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel4)));
			jLabel4.setText("<html>-Invocacion: tecla N.<html>");
			jLabel4.setFont(new Font("Arial Rounded MT Bold", 1, 14));
			jLabel4.setBounds(40, 152, 230, 50);
			jLabel4.setEnabled(false);
			jLabel4.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/juego/inv02.png")))));
			SeparatorIzq = new JSeparator();
			getContentPane().add(((java.awt.Component) (SeparatorIzq)));
			SeparatorIzq.setOrientation(1);
			SeparatorIzq.setLayout(((java.awt.LayoutManager) (null)));
			SeparatorIzq.setBounds(363, 12, 13, 227);
			SeparatorDer = new JSeparator();
			getContentPane().add(((java.awt.Component) (SeparatorDer)));
			SeparatorDer.setOrientation(1);
			SeparatorDer.setLayout(((java.awt.LayoutManager) (null)));
			SeparatorDer.setBounds(553, 12, 27, 227);
			SeparatorAba = new JSeparator();
			getContentPane().add(((java.awt.Component) (SeparatorAba)));
			SeparatorAba.setLayout(((java.awt.LayoutManager) (null)));
			SeparatorAba.setBounds(363, 238, 192, 9);
			SeparadorArri = new JSeparator();
			getContentPane().add(((java.awt.Component) (SeparadorArri)));
			SeparadorArri.setLayout(((java.awt.LayoutManager) (null)));
			SeparadorArri.setBounds(363, 11, 191, 20);
			jLabel5 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel5)));
			jLabel5.setText("Nivel");
			jLabel5.setFont(new Font("Arial Rounded MT Bold", 1, 20));
			jLabel5.setBounds(372, 21, 105, 44);
			javax.swing.ComboBoxModel comboNivelModel = ((javax.swing.ComboBoxModel) (new DefaultComboBoxModel(((Object []) (new String[] {
					"Facil", "Medio", "Dificil", "Experto"
			}
					)))));
			comboNivel = new JComboBox();
			getContentPane().add(((java.awt.Component) (comboNivel)));
			comboNivel.setModel(comboNivelModel);
			comboNivel.setFont(new Font("Rockwell", 0, 14));
			comboNivel.setToolTipText("Selecciona el nivel de dificultad");
			comboNivel.setBounds(451, 21, 93, 40);
			comboNivel.addActionListener(((ActionListener) (this)));
			jLabel6 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel6)));
			jLabel6.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/titulos/titulo01.png")))));
			jLabel6.setBounds(170, 300, 250, 70);
			btnSalir = new JButton();
			getContentPane().add(((java.awt.Component) (btnSalir)));
			btnSalir.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/botones/btnSalir.png")))));
			btnSalir.setBounds(344, 375, 210, 60);
			btnSalir.addActionListener(((ActionListener) (this)));
			jLabel7 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel7)));
			jLabel7.setBounds(52, 203, 196, 17);
			jLabel7.setText("<html>-Pausar Juego: tecla Esc.<html>");
			jLabel7.setEnabled(false);
			jLabel7.setFont(new Font("Arial Rounded MT Bold", 1, 14));
			jLabel8 = new JLabel();
			getContentPane().add(((java.awt.Component) (jLabel8)));
			jLabel8.setText("jLabel8");
			jLabel8.setBounds(-1, 0, 610, 451);
			jLabel8.setIcon(((javax.swing.Icon) (new ImageIcon(((Object)this).getClass().getClassLoader().getResource("res/fondos/fondo2.png")))));
			pack();
			setSize(611, 484);
		}catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == btnJugar) {
			setVisible(false);
			admin = new Administrador(ventanaPrincipal);
			ventanaPrincipal.setAdmin(admin);
			ventanaPrincipal.getAdmin().setDificultad(comboNivel.getSelectedIndex() + 1);
			ventanaPrincipal.getHiloInicial().start();
		}
		if (e.getSource() == btnSalir) {
			int decision = JOptionPane.showConfirmDialog(((java.awt.Component) (this)), "<html>Desea salir del juego?<html>");
			if (decision == 0)
				System.exit(0);
		}
	}
}